﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PromotionApp.UserControl
{
    public partial class ucCommand : System.Web.UI.UserControl
    {
        #region Property

        public Button AddCommand
        {
            get
            {
                return this.btnAdd;
            }
        }

        public Button EditCommand
        {
            get
            {
                return this.btnEdit;
            }
        }

        public Button DeleteCommand
        {
            get
            {
                return this.btnDelete;
            }
        }

        public Button SearchCommand
        {
            get
            {
                return this.btnSearch;
            }
        }

        public Button SaveCommand
        {
            get
            {
                return this.btnSave;
            }
        }

        public Button ResetCommand
        {
            get
            {
                return this.btnReset;
            }
        }

        public Button CancelCommand
        {
            get
            {
                return this.btnCancel;
            }
        }

        #endregion

        #region Public Variable

        public event EventHandler OnAddItem = null;
        public event EventHandler OnEditItem = null;
        public event EventHandler OnDeleteItem = null;
        public event EventHandler OnSearchItem = null;
        public event EventHandler OnSaveItem = null;
        public event EventHandler OnCancelItem = null;
        public event EventHandler OnResetItem = null;

        #endregion

        #region Event

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (this.OnAddItem != null)
                this.OnAddItem(this, new EventArgs());
        }

        protected void btnEdit_Click(object sender, EventArgs e)
        {
            if (this.OnEditItem != null)
                this.OnEditItem(this, new EventArgs());
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            if (this.OnDeleteItem != null)
                this.OnDeleteItem(this, new EventArgs());
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (this.OnSearchItem != null)
                this.OnSearchItem(this, new EventArgs());
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (this.OnSaveItem != null)
                this.OnSaveItem(this, new EventArgs());
        }

        protected void btnReset_Click(object sender, EventArgs e)
        {
            if (this.OnResetItem != null)
                this.OnResetItem(this, new EventArgs());
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            if (this.OnCancelItem != null)
                this.OnCancelItem(this, new EventArgs());
        }

        #endregion
    }
}